#!/usr/bin/env bash

cd $(dirname $0)

JSON_FORMAT=$(cat <<EOF

import sys
import json
str=""
for line in sys.stdin:
    str+=line
print(json.dumps(json.loads(str), ensure_ascii=False, indent=4, sort_keys=True))
EOF
)

paras+=' --data-urlencode pk=hupu_app'
paras+=' --data-urlencode t=10000'
paras+=' --data-urlencode token=xxx'
paras+=' --data-urlencode keyword=科比'
paras+=' --data-urlencode page=1'
paras+=' --data-urlencode size=20'
paras+=' --data-urlencode sort='
paras+=' --data-urlencode platform=android'
paras+=' --data-urlencode fid='
paras+=' --data-urlencode league='
echo $paras_s

cmd="curl -G $paras localhost:8888/hello"
echo $cmd
eval $cmd | python3 -c "$JSON_FORMAT"
#curl -G $paras localhost:8888/hello | python3 -c "$JSON_FORMAT"
